<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.3w.org/TR/xhtml1/DTD/xhtml1-transitional.dts">
<html xmlns="http://www.3w.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Electronic shopping&nbsp;<?php echo "-&nbsp;".$this->escape($this->title); ?></title>

        <link rel="stylesheet" type="text/css" media="screen"
             href="<?php echo $this->baseUrl();?>/css/site.css" />
        
    </head>
    <body>
    <div id="page-container">
        <div id="header">
          
        </div>

        
        <div id="main-nav">
            
            <ul id="menu">
                <li><a href="<?php echo $this->baseUrl();?>" target="_self" title="Home">Home</a></li>
                <li><a href="<?php echo $this->url(array('controller'=>'index',
            'action'=>'index'));?>" target="_self" title="View Product">Product</a></li>
                <li><a href="<?php echo $this->url(array('controller'=>'index',
            'action'=>'contact'));?>" target="_self" title="Contact Us">Contact Us</a></li>
                <li><a href="<?php echo $this->url(array('controller'=>'index',
            'action'=>'about'));?>" target="_self" title="About">About</a></li>
            </ul>
            
        </div>

        <div id="toolbar">
            <div id="searchbar">
                <form action="<?php echo $this->url(array('module'=>'default',
                                'controller'=>'index',
                                'action'=>'search')); ?>">
                    Search: <input type="text" name="keyword"/>
                    <input type="submit" name="submit" value="Search"/>
                </form>
            </div>
            <div id="loginbar">
                <font size="2">
                <?php if (Zend_Auth::getInstance()->hasIdentity()) :?>
                    Welcome:&nbsp;<?php echo Zend_Auth::getInstance()->getIdentity()->username;?>&nbsp;
                    <a style="color:#800080" href="<?php echo $this->baseUrl();?>/index/logout">Logout</a>&nbsp;&nbsp;
                    <a style="color:#800080" href="<?php echo $this->baseUrl();?>/user/order/view">Your order</a>
                <?php else: ?>
                    <a style="color:#800080" href="<?php echo $this->baseUrl();?>/index/login">Login</a>
                    <a style="color:#800080" href="<?php echo $this->baseUrl();?>/account/add">Register</a>
                <?php endif; ?>
                </font>
            </div>
        </div>

        <div id="sidebar-a">
            <h3>Category</h3>
            <a href="<?php echo $this->url(array('controller'=>'index',
            'action'=>'index', 'id'=>0));?>">
                View All
            </a><br/>
            <?php 
            $cates = new Category();
            $cateList = $cates->fetchAll();
            foreach($cateList as $cate) : ?>
            <a href="<?php echo $this->url(array('controller'=>'index',
            'action'=>'index', 'id'=>$cate->id));?>">
                <?php echo $this->escape($cate->name);?>
            </a><br/>
            <?php endforeach; ?>
            <br>

            <br>
            <a href="<?php echo $this->baseUrl();?>/order"
                        style="color:#800080">View your cart</a>
        </div>

        <div id="content">
            <?php echo $this->layout()->content; ?>
        </div>

        <div id="footer">
            APCS-07-DevTeam@Copyright
        </div>
    </div>
    </body>
</html>
